Statistics

Stat.binmean

using Gadfly, RDatasets
set_default_plot_size(21cm, 8cm)
p1 = plot(dataset("datasets", "iris"), x="SepalLength", y="SepalWidth",
          Geom.point)
p2 = plot(dataset("datasets", "iris"), x="SepalLength", y="SepalWidth",
          Stat.binmean, Geom.point)
hstack(p1,p2)
SepalLength -1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0 10.5 11.0 11.5 12.0 0 5 10 15 0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 3.8 4.0 4.2 4.4 4.6 4.8 5.0 5.2 5.4 5.6 5.8 6.0 6.2 6.4 6.6 6.8 7.0 7.2 7.4 7.6 7.8 8.0 8.2 8.4 8.6 8.8 9.0 9.2 9.4 9.6 9.8 10.0 10.2 10.4 10.6 10.8 11.0 11.2 11.4 11.6 11.8 12.0 7.6253.0875 7.1400000000000013.2 6.8571428571428563.0714285714285716 6.68000000000000153.0300000000000002 6.5,3.0 6.39999999999999952.9571428571428577 6.2999999999999992.8555555555555556 6.22.8249999999999997 6.052.7916666666666665 5.9000000000000013.0666666666666664 5.7999999999999992.8857142857142857 5.7000000000000013.1 5.60000000000000052.816666666666667 5.4428571428571433.207142857142857 5.2,3.425 5.10000000000000053.477777777777778 4.96253.05625 4.7714285714285713.185714285714286 4.4888888888888893.0777777777777775 h,j,k,l,arrows,drag to pan i,o,+,-,scroll,shift-drag to zoom r,dbl-click to reset c for coordinates ? for help ? 1.75 2.00 2.25 2.50 2.75 3.00 3.25 3.50 3.75 4.00 4.25 4.50 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00 4.05 4.10 4.15 4.20 4.25 2 3 4 5 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00 4.05 4.10 4.15 4.20 4.25 SepalWidth SepalLength -1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0 10.5 11.0 11.5 12.0 0 5 10 15 0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 3.8 4.0 4.2 4.4 4.6 4.8 5.0 5.2 5.4 5.6 5.8 6.0 6.2 6.4 6.6 6.8 7.0 7.2 7.4 7.6 7.8 8.0 8.2 8.4 8.6 8.8 9.0 9.2 9.4 9.6 9.8 10.0 10.2 10.4 10.6 10.8 11.0 11.2 11.4 11.6 11.8 12.0 5.9,3.0 6.2,3.4 6.5,3.0 6.3,2.5 6.7,3.0 6.7,3.3 6.8,3.2 5.8,2.7 6.9,3.1 6.7,3.1 6.9,3.1 6.0,3.0 6.4,3.1 6.3,3.4 7.7,3.0 6.1,2.6 6.3,2.8 6.4,2.8 7.9,3.8 7.4,2.8 7.2,3.0 6.4,2.8 6.1,3.0 6.2,2.8 7.2,3.2 6.7,3.3 6.3,2.7 7.7,2.8 5.6,2.8 6.9,3.2 6.0,2.2 7.7,2.6 7.7,3.8 6.5,3.0 6.4,3.2 5.8,2.8 5.7,2.5 6.8,3.0 6.4,2.7 6.5,3.2 7.2,3.6 6.7,2.5 7.3,2.9 4.9,2.5 7.6,3.0 6.5,3.0 6.3,2.9 7.1,3.0 5.8,2.7 6.3,3.3 5.7,2.8 5.1,2.5 6.2,2.9 5.7,2.9 5.7,3.0 5.6,2.7 5.0,2.3 5.8,2.6 6.1,3.0 5.5,2.6 5.5,2.5 5.6,3.0 6.3,2.3 6.7,3.1 6.0,3.4 5.4,3.0 6.0,2.7 5.8,2.7 5.5,2.4 5.5,2.4 5.7,2.6 6.0,2.9 6.7,3.0 6.8,2.8 6.6,3.0 6.4,2.9 6.1,2.8 6.3,2.5 6.1,2.8 5.9,3.2 5.6,2.5 6.2,2.2 5.8,2.7 5.6,3.0 6.7,3.1 5.6,2.9 6.1,2.9 6.0,2.2 5.9,3.0 5.0,2.0 5.2,2.7 6.6,2.9 4.9,2.4 6.3,3.3 5.7,2.8 6.5,2.8 5.5,2.3 6.9,3.1 6.4,3.2 7.0,3.2 5.0,3.3 5.3,3.7 4.6,3.2 5.1,3.8 4.8,3.0 5.1,3.8 5.0,3.5 4.4,3.2 4.5,2.3 5.0,3.5 5.1,3.4 4.4,3.0 4.9,3.6 5.5,3.5 5.0,3.2 4.9,3.1 5.5,4.2 5.2,4.1 5.4,3.4 4.8,3.1 4.7,3.2 5.2,3.4 5.2,3.5 5.0,3.4 5.0,3.0 4.8,3.4 5.1,3.3 4.6,3.6 5.1,3.7 5.4,3.4 5.1,3.8 5.7,3.8 5.1,3.5 5.4,3.9 5.7,4.4 5.8,4.0 4.3,3.0 4.8,3.0 4.8,3.4 5.4,3.7 4.9,3.1 4.4,2.9 5.0,3.4 4.6,3.4 5.4,3.9 5.0,3.6 4.6,3.1 4.7,3.2 4.9,3.0 5.1,3.5 h,j,k,l,arrows,drag to pan i,o,+,-,scroll,shift-drag to zoom r,dbl-click to reset c for coordinates ? for help ? -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 -0.6 -0.4 -0.2 0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 3.8 4.0 4.2 4.4 4.6 4.8 5.0 5.2 5.4 5.6 5.8 6.0 6.2 6.4 6.6 6.8 7.0 -2.5 0.0 2.5 5.0 7.5 -0.5 -0.4 -0.3 -0.2 -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 3.0 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 4.0 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 5.0 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 6.0 6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 6.9 7.0 SepalWidth

Stat.density

using DataFrames, Gadfly, Distributions
set_default_plot_size(21cm, 8cm)
x = -4:0.1:4
Da = [DataFrame(x=x, ymax=pdf.(Normal(μ),x), ymin=0.0, u="μ=$μ") for μ in [-1,1]]
Db = [DataFrame(x=randn(200).+μ, u="μ=$μ") for μ in [-1,1]]

p1 = plot(vcat(Da...), x=:x, y=:ymax, ymin=:ymin, ymax=:ymax, color=:u,
    Geom.line, Geom.ribbon, Guide.ylabel("Density"), Theme(alphas=[0.6]),
    Guide.colorkey(title="", pos=[2.5,0.6]), Guide.title("Parametric PDF")
)
p2 = plot(vcat(Db...), x=:x, color=:u, Theme(alphas=[0.6]),
    Stat.density(bandwidth=0.5), Geom.polygon(fill=true, preserve_order=true),
    Coord.cartesian(xmin=-4, xmax=4, ymin=0, ymax=0.4),
    Guide.colorkey(title="", pos=[2.5,0.6]), Guide.title("Kernel PDF")
)
hstack(p1,p2)
x -14 -12 -10 -8 -6 -4 -2 0 2 4 6 8 10 12 14 -12.0 -11.5 -11.0 -10.5 -10.0 -9.5 -9.0 -8.5 -8.0 -7.5 -7.0 -6.5 -6.0 -5.5 -5.0 -4.5 -4.0 -3.5 -3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0 10.5 11.0 11.5 12.0 -20 -10 0 10 20 -12.0 -11.5 -11.0 -10.5 -10.0 -9.5 -9.0 -8.5 -8.0 -7.5 -7.0 -6.5 -6.0 -5.5 -5.0 -4.5 -4.0 -3.5 -3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0 10.5 11.0 11.5 12.0 h,j,k,l,arrows,drag to pan i,o,+,-,scroll,shift-drag to zoom r,dbl-click to reset c for coordinates ? for help ? μ=-1 μ=1 -0.5 -0.4 -0.3 -0.2 -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 -0.4 -0.3 -0.2 -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 -0.5 0.0 0.5 1.0 -0.40 -0.38 -0.36 -0.34 -0.32 -0.30 -0.28 -0.26 -0.24 -0.22 -0.20 -0.18 -0.16 -0.14 -0.12 -0.10 -0.08 -0.06 -0.04 -0.02 0.00 0.02 0.04 0.06 0.08 0.10 0.12 0.14 0.16 0.18 0.20 0.22 0.24 0.26 0.28 0.30 0.32 0.34 0.36 0.38 0.40 0.42 0.44 0.46 0.48 0.50 0.52 0.54 0.56 0.58 0.60 0.62 0.64 0.66 0.68 0.70 0.72 0.74 0.76 0.78 0.80 0.82 Kernel PDF x -14 -12 -10 -8 -6 -4 -2 0 2 4 6 8 10 12 14 -12.0 -11.5 -11.0 -10.5 -10.0 -9.5 -9.0 -8.5 -8.0 -7.5 -7.0 -6.5 -6.0 -5.5 -5.0 -4.5 -4.0 -3.5 -3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0 10.5 11.0 11.5 12.0 -20 -10 0 10 20 -12.0 -11.5 -11.0 -10.5 -10.0 -9.5 -9.0 -8.5 -8.0 -7.5 -7.0 -6.5 -6.0 -5.5 -5.0 -4.5 -4.0 -3.5 -3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0 10.5 11.0 11.5 12.0 h,j,k,l,arrows,drag to pan i,o,+,-,scroll,shift-drag to zoom r,dbl-click to reset c for coordinates ? for help ? μ=-1 μ=1 -0.5 -0.4 -0.3 -0.2 -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 -0.4 -0.3 -0.2 -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 -0.5 0.0 0.5 1.0 -0.40 -0.38 -0.36 -0.34 -0.32 -0.30 -0.28 -0.26 -0.24 -0.22 -0.20 -0.18 -0.16 -0.14 -0.12 -0.10 -0.08 -0.06 -0.04 -0.02 0.00 0.02 0.04 0.06 0.08 0.10 0.12 0.14 0.16 0.18 0.20 0.22 0.24 0.26 0.28 0.30 0.32 0.34 0.36 0.38 0.40 0.42 0.44 0.46 0.48 0.50 0.52 0.54 0.56 0.58 0.60 0.62 0.64 0.66 0.68 0.70 0.72 0.74 0.76 0.78 0.80 0.82 Density Parametric PDF

Stat.quantile_bars

using CategoricalArrays
using Gadfly
set_default_plot_size(14cm, 8cm)
n = 400
group = repeat([-1, 1], inner=200)
x = randn(n) .+ group

plot(x=x, color=categorical(group), Guide.colorkey(title="", pos=[3.6,0.7]),
    layer(Stat.density, Geom.line, Geom.polygon(fill=true, preserve_order=true), alpha=[0.4]),
    layer(Stat.quantile_bars(quantiles=[0.05, 0.95]), Geom.segment),
    Guide.title("Density with bars showing the central 90% CI"),
    Guide.ylabel("Density"), Coord.cartesian(xmin=-4, xmax=4)
)
x -14 -12 -10 -8 -6 -4 -2 0 2 4 6 8 10 12 14 -12.0 -11.5 -11.0 -10.5 -10.0 -9.5 -9.0 -8.5 -8.0 -7.5 -7.0 -6.5 -6.0 -5.5 -5.0 -4.5 -4.0 -3.5 -3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0 10.5 11.0 11.5 12.0 -20 -10 0 10 20 -12.0 -11.5 -11.0 -10.5 -10.0 -9.5 -9.0 -8.5 -8.0 -7.5 -7.0 -6.5 -6.0 -5.5 -5.0 -4.5 -4.0 -3.5 -3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0 10.5 11.0 11.5 12.0 h,j,k,l,arrows,drag to pan i,o,+,-,scroll,shift-drag to zoom r,dbl-click to reset c for coordinates ? for help ? -1 1 -0.6 -0.5 -0.4 -0.3 -0.2 -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 -0.50 -0.45 -0.40 -0.35 -0.30 -0.25 -0.20 -0.15 -0.10 -0.05 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 -0.5 0.0 0.5 1.0 -0.50 -0.48 -0.46 -0.44 -0.42 -0.40 -0.38 -0.36 -0.34 -0.32 -0.30 -0.28 -0.26 -0.24 -0.22 -0.20 -0.18 -0.16 -0.14 -0.12 -0.10 -0.08 -0.06 -0.04 -0.02 0.00 0.02 0.04 0.06 0.08 0.10 0.12 0.14 0.16 0.18 0.20 0.22 0.24 0.26 0.28 0.30 0.32 0.34 0.36 0.38 0.40 0.42 0.44 0.46 0.48 0.50 0.52 0.54 0.56 0.58 0.60 0.62 0.64 0.66 0.68 0.70 0.72 0.74 0.76 0.78 0.80 0.82 0.84 0.86 0.88 0.90 0.92 0.94 0.96 0.98 1.00 Density Density with bars showing the central 90% CI

Stat.dodge

using DataFrames, Gadfly, RDatasets, Statistics
set_default_plot_size(21cm, 8cm)
salaries = dataset("car","Salaries")
salaries.Salary /= 1000.0
salaries.Discipline = ["Discipline $(x)" for x in salaries.Discipline]
df = combine(groupby(salaries, [:Rank, :Discipline]), :Salary.=>mean)
df.label = string.(round.(Int, df.Salary_mean))

p1 = plot(df, x=:Discipline, y=:Salary_mean, color=:Rank,
    Scale.x_discrete(levels=["Discipline A", "Discipline B"]),
    label=:label, Geom.label(position=:centered), Stat.dodge(position=:stack),
    Geom.bar(position=:stack)
)
p2 = plot(df, y=:Discipline, x=:Salary_mean, color=:Rank,
    Coord.cartesian(yflip=true), Scale.y_discrete,
    label=:label, Geom.label(position=:right), Stat.dodge(axis=:y),
    Geom.bar(position=:dodge, orientation=:horizontal),
    Scale.color_discrete(levels=["Prof", "AssocProf", "AsstProf"]),
    Guide.yticks(orientation=:vertical), Guide.ylabel(nothing)
)
hstack(p1, p2)
Salary_mean -200 -150 -100 -50 0 50 100 150 200 250 300 350 -150 -140 -130 -120 -110 -100 -90 -80 -70 -60 -50 -40 -30 -20 -10 0 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210 220 230 240 250 260 270 280 290 300 -200 0 200 400 -150 -145 -140 -135 -130 -125 -120 -115 -110 -105 -100 -95 -90 -85 -80 -75 -70 -65 -60 -55 -50 -45 -40 -35 -30 -25 -20 -15 -10 -5 0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100 105 110 115 120 125 130 135 140 145 150 155 160 165 170 175 180 185 190 195 200 205 210 215 220 225 230 235 240 245 250 255 260 265 270 275 280 285 290 295 300 Prof AssocProf AsstProf Rank 133 85 101 120 83 74 h,j,k,l,arrows,drag to pan i,o,+,-,scroll,shift-drag to zoom r,dbl-click to reset c for coordinates ? for help ? Discipline B Discipline A Discipline B Discipline A Discipline Discipline A Discipline B Prof AsstProf AssocProf Rank 133 85 101 120 83 74 h,j,k,l,arrows,drag to pan i,o,+,-,scroll,shift-drag to zoom r,dbl-click to reset c for coordinates ? for help ? -500 -400 -300 -200 -100 0 100 200 300 400 500 600 700 800 900 -400 -350 -300 -250 -200 -150 -100 -50 0 50 100 150 200 250 300 350 400 450 500 550 600 650 700 750 800 -500 0 500 1000 -400 -380 -360 -340 -320 -300 -280 -260 -240 -220 -200 -180 -160 -140 -120 -100 -80 -60 -40 -20 0 20 40 60 80 100 120 140 160 180 200 220 240 260 280 300 320 340 360 380 400 420 440 460 480 500 520 540 560 580 600 620 640 660 680 700 720 740 760 780 800 Salary_mean

Stat.func

using DataFrames, Gadfly
set_default_plot_size(14cm, 8cm)
sigmoid(x) = 1 ./ (1 .+ exp.(-x))
npoints = 30
gshift, x = rand([0,2], npoints), range(-9, 9, length=npoints)
y, ye = sigmoid(x+gshift), 0.2*rand(npoints)
df = DataFrame(x=x, y=y, ymin=y-ye, ymax=y+ye, g=gshift)

plot(y=[sigmoid, x->sigmoid(x+2)], xmin=[-10], xmax=[10],
    Geom.line, Stat.func(100), color=[0,2], Guide.xlabel("x"),
    layer(df, x=:x, y=:y, ymin=:ymin, ymax=:ymax, color=:g,
        Geom.point, Geom.yerrorbar, Stat.x_jitter(range=1)),
    Scale.color_discrete_manual("deepskyblue","yellow3", levels=[0,2]),
    Guide.colorkey(title="Function", labels=["Sigmoid(x)", "Sigmoid(x+2)"]),
    Theme(errorbar_cap_length=0mm, key_position=:inside)
)
x -35 -30 -25 -20 -15 -10 -5 0 5 10 15 20 25 30 35 -30 -28 -26 -24 -22 -20 -18 -16 -14 -12 -10 -8 -6 -4 -2 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 -40 -20 0 20 40 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19 -18 -17 -16 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 9.0141046600311480.9998766054240137 8.6927540025953610.9999689322859989 8.1439459673205050.9995731370872474 7.5339262418893150.9992062365897446 6.6189131357520840.9998000496254946 5.547565393392760.9996281141773367 5.0757871084144220.999308435318234 4.3911606127179690.9987143089615129 4.1168057252619660.982612832728348 3.1354122445179220.9681328340340032 2.73212982377129960.9423020076914295 2.3910512889365950.8977447634316474 1.2028286926363470.9721241862548583 0.76812760129307690.9493594320914616 0.151905903768971230.5769694274020658 -0.249320961278248680.8441788063113398 -0.8281913982033450.7444001360376136 -1.58342552357296950.610229226597668 -2.10681175390071160.45700301154629586 -3.18894341318910430.05769799230857057 -3.2464350186055960.03186716596599677 -4.1491536301362420.017387167271651932 -4.6106589343894060.06567092533092088 -4.9267611518636330.036408609346018014 -5.8616504657392570.002741371708568133 -6.7756507565596650.010801164785603749 -7.01153531072300850.00583556787482027 -7.9328016384674130.00042686291275275794 -8.4381743082221340.00022951552431103904 -8.9822199994533580.0009110511944006454 h,j,k,l,arrows,drag to pan i,o,+,-,scroll,shift-drag to zoom r,dbl-click to reset c for coordinates ? for help ? Sigmoid(x) Sigmoid(x+2) Function -3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 -4 -2 0 2 4 -2.5 -2.4 -2.3 -2.2 -2.1 -2.0 -1.9 -1.8 -1.7 -1.6 -1.5 -1.4 -1.3 -1.2 -1.1 -1.0 -0.9 -0.8 -0.7 -0.6 -0.5 -0.4 -0.3 -0.2 -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 3.0 3.1 3.2 3.3 3.4 3.5 y

Stat.qq

using Distributions, Gadfly, RDatasets
set_default_plot_size(21cm, 8cm)
iris, geyser = dataset.("datasets", ["iris", "faithful"])
df = combine(groupby(iris, :Species), :SepalLength=>(x->fit(Normal, x))=>:d)
ds2 = fit.([Normal, Uniform], [geyser.Eruptions])

yeqx(x=4:6) = layer(x=x, Geom.abline(color="gray80"))
xylabs = [Guide.xlabel("Theoretical q"), Guide.ylabel("Sample q")]
p1 = plot(df, x=:d, y=iris[:,1], color=:Species, Stat.qq, yeqx(4:8),
    xylabs..., Guide.title("3 Samples, 1 Distribution"))
p2 = plot(geyser, x=ds2, y=:Eruptions, color=["Normal","Uniform"], Stat.qq,
    yeqx(0:6), xylabs..., Guide.title("1 Sample, 2 Distributions"),
  Theme(discrete_highlight_color=c->nothing, alphas=[0.5], point_size=2pt)
)
hstack(p1, p2)
Theoretical q -10 -8 -6 -4 -2 0 2 4 6 8 10 12 14 16 18 -8.0 -7.5 -7.0 -6.5 -6.0 -5.5 -5.0 -4.5 -4.0 -3.5 -3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0 10.5 11.0 11.5 12.0 12.5 13.0 13.5 14.0 14.5 15.0 15.5 16.0 -10 0 10 20 -8.0 -7.5 -7.0 -6.5 -6.0 -5.5 -5.0 -4.5 -4.0 -3.5 -3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0 10.5 11.0 11.5 12.0 12.5 13.0 13.5 14.0 14.5 15.0 15.5 16.0 Normal Uniform Color 5.0870848708487085.067 5.0741697416974175.033 5.0612546125461265.0 5.0483394833948344.933 5.0354243542435424.933 5.022509225092254.933 5.0095940959409594.9 4.9966789667896684.8999999999999995 4.9837638376383764.883 4.9708487084870844.85 4.9579335793357924.833 4.9450184501845024.833 4.932103321033214.817 4.91918819188191854.817 4.9062730627306274.8 4.8933579335793364.8 4.8804428044280444.8 4.8675276752767534.8 4.8546125461254614.8 4.8416974169741694.8 4.8287822878228784.783 4.8158671586715874.767 4.8029520295202954.75 4.7900369003690034.732999999999999 4.7771217712177124.716000000000001 4.764206642066424.7 4.7512915129151294.7 4.7383763837638374.7 4.7254612546125454.7 4.71254612546125354.7 4.6996309963099634.7 4.68671586715867154.667 4.673800738007384.666999999999999 4.6608856088560894.650000000000001 4.6479704797047974.633 4.6350553505535064.633 4.6221402214022144.633 4.6092250922509224.617 4.596309963099634.6 4.5833948339483394.6 4.5704797047970484.6 4.5575645756457564.6 4.5446494464944644.583 4.5317343173431734.583 4.5188191881918824.583 4.505904059040594.583 4.4929889298892984.567 4.48007380073800654.567 4.46715867158671554.567 4.45424354243542454.549999999999999 4.4413284132841334.533 4.4284132841328414.533 4.4154981549815494.533 4.4025830258302594.533 4.3896678966789674.533 4.3767527675276754.517 4.3638376383763834.5 4.3509225092250924.5 4.33800738007384.5 4.3250922509225094.5 4.3121771217712174.5 4.2992619926199254.5 4.2863468634686344.5 4.2734317343173434.5 4.26051660516605154.4830000000000005 4.247601476014764.467 4.2346863468634694.467 4.2217712177121774.45 4.2088560885608864.45 4.1959409594095944.449999999999999 4.1830258302583024.433 4.1701107011070114.433 4.157195571955724.417 4.1442804428044284.417 4.1313653136531364.417 4.1184501845018454.417 4.1055350553505534.4 4.0926199261992624.383 4.079704797047974.367 4.0667896678966784.367 4.0538745387453874.367 4.04095940959409554.365999999999999 4.02804428044280454.3500000000000005 4.0151291512915134.35 4.0022140221402214.35 3.98929889298892974.35 3.97638376383763834.333 3.96346863468634644.333 3.95055350553505544.333 3.93763837638376354.333 3.9247232472324724.333 3.91180811808118064.317000000000001 3.8988929889298894.3 3.88597785977859774.3 3.87306273062730584.283 3.86014760147601484.283 3.8472324723247234.267 3.83431734317343144.267 3.821402214022144.25 3.80848708487084854.25 3.7955719557195574.25 3.78265682656826564.25 3.7697416974169744.2330000000000005 3.75682656826568234.233 3.74391143911439134.233 3.73099630996309944.2 3.7180811808118084.183 3.70516605166051654.167 3.6922509225092254.167 3.6793357933579334.167 3.66642066420664174.166999999999999 3.65350553505535074.150000000000001 3.6405904059040594.15 3.62767527675276744.15 3.6147601476014764.15 3.60184501845018454.133 3.58892988929889264.133 3.57601476014760164.117 3.56309963099630974.116999999999999 3.5501845018450184.1 3.53726937269372684.1 3.52435424354243534.083 3.5114391143911444.083 3.4985239852398524.083 3.4856088560885614.083 3.4726937269372694.083 3.4597785977859784.067 3.4468634686346864.066999999999999 3.43394833948339474.05 3.42103321033210334.033 3.40811808118081144.033 3.39520295202952044.000000000000001 3.38228782287822854.0 3.36937269372693754.0 3.35645756457564564.0 3.3435424354243544.0 3.33062730627306274.0 3.31771217712177123.967 3.304797047970483.966 3.2918819188191883.95 3.27896678966789653.95 3.2660516605166053.917 3.25313653136531363.917 3.2402214022140223.917 3.227306273062733.883 3.2143911439114393.85 3.20147601476014733.85 3.18856088560885633.8330000000000006 3.17564575645756443.833 3.1627306273062733.833 3.14981549815498153.833 3.13690036900368963.8329999999999997 3.12398523985239863.817 3.11107011070110673.767 3.09815498154981533.767 3.0852398523985243.75 3.07232472324723243.733 3.0594095940959413.7170000000000005 3.04649446494464953.683 3.0335793357933583.6 3.0206642066420663.6 3.00774907749077473.6 2.99483394833948323.6 2.9819188191881923.567 2.96900369003690033.5669999999999993 2.9560885608856093.5 2.94317343173431743.5 2.93025830258302563.450000000000001 2.91734317343173453.417 2.90442804428044273.367 2.8915129151291513.333 2.87859778597785983.333 2.8656826568265683.317 2.8527675276752773.067 2.8398523985239852.8999999999999995 2.8269372693726942.883 2.8140221402214022.800000000000001 2.80110701107011062.6330000000000022 2.7881918819188192.617 2.77527675276752772.483 2.76236162361623632.417 2.74944649446494442.417 2.7365313653136532.4 2.72361623616236152.4 2.710701107011072.3829999999999996 2.69778597785977862.367 2.6848708487084872.3500000000000005 2.67195571955719572.333 2.6590405904059042.317 2.6461254612546132.3 2.6332103321033212.2829999999999995 2.62029520295202942.267 2.6073800738007382.25 2.59446494464944652.25 2.5815498154981552.233 2.56863468634686362.233 2.5557195571955722.2170000000000005 2.54280442804428032.2 2.5298892988929892.2 2.51697416974169742.2 2.5040590405904062.183 2.49114391143911452.167 2.47822878228782262.167 2.46531365313653162.15 2.45239852398523972.133 2.43948339483394832.1 2.4265682656826572.1 2.41365313653136542.1 2.4007380073800742.083 2.3878228782287822.083 2.3749077490774912.067 2.3619926199261992.033 2.34907749077490772.033 2.33616236162361622.017 2.3232472324723252.017 2.31033210332103332.017 2.29741697416974142.0 2.284501845018452.0 2.27158671586715852.0 2.2586715867158672.0 2.24575645756457561.983 2.2328413284132841.983 2.21992619926199271.9829999999999999 2.20701107011070131.9670000000000003 2.194095940959411.967 2.1811808118081181.967 2.16826568265682651.95 2.1553505535055351.933 2.14243542435424361.933 2.1295202952029521.917 2.11660516605166031.9169999999999998 2.10369003690036931.883 2.09077490774907741.883 2.0778597785977861.883 2.06494464944649451.883 2.0520295202952031.867 2.03911439114391161.867 2.026199261992621.867 2.01328413284132871.867 2.0003690036900371.867 1.98745387453874531.867 1.97453874538745391.867 1.96162361623616241.867 1.9487084870848711.85 1.93579335793357931.85 1.92287822878228791.833 1.90996309963099641.833 1.89704797047970471.833 1.88413284132841331.833 1.87121771217712191.833 1.85830258302583041.833 1.84538745387453871.833 1.83247232472324731.817 1.81955719557195581.817 1.80664206642066421.817 1.79372693726937271.8 1.78081180811808131.8 1.76789667896678981.8 1.75498154981549811.8 1.74206642066420671.783 1.72915129151291521.783 1.71623616236162381.75 1.70332103321033211.75 1.69040590405904071.75 1.67749077490774921.75 1.66457564575645761.75 1.6516605166051661.75 1.63874538745387471.733 1.62583025830258321.7 1.61291512915129151.667 6.5401059126598185.067 6.2655669112023745.033 6.0943827937547115.0 5.96737024884597664.933 5.86528793030014.933 5.7793432161796754.933 5.7047500751407644.9 5.6386029069723414.8999999999999995 5.5789998638629124.883 5.5246254048191634.85 5.47453017303263154.833 5.4280056880042284.833 5.3845086178821834.817 5.3436127608382954.817 5.3049773680977914.8 5.2683255429860484.8 5.2334290897015854.8 5.20009762472898454.8 5.1681705843823954.8 5.1375112481151524.8 5.108002195005164.783 5.0795417986349374.767 5.05204148714744954.75 5.0254235757812034.732999999999999 4.99961953364376654.716000000000001 4.974568584006584.7 4.95021656370364.7 4.9265149859372254.7 4.9034202643115644.7 4.880893065800384.7 4.8588977676769334.7 4.8374019989129424.667 4.8163762506989024.666999999999999 4.7957935439037814.650000000000001 4.7756291437315124.633 4.7558603137274784.633 4.7364661027729924.633 4.7174271598773364.617 4.6987255725077884.6 4.6803447249426224.6 4.66226917373109554.6 4.6444845378295114.6 4.6269774013771374.583 4.6097352273987774.583 4.5927462809864874.583 4.57599956073234454.583 4.5594847373664234.567 4.5431920987059824.567 4.5271125001490324.567 4.5112373200522264.549999999999999 4.4955584194232464.533 4.4800681054340574.533 4.4647590983262874.533 4.4496245013352274.533 4.4346577733061634.533 4.4198527037173224.517 4.40520338985852264.5 4.3907042159447234.5 4.3763498339696574.5 4.3621351461273254.5 4.3480552886486854.5 4.3341056169180454.5 4.3202816917485344.5 4.3065792667091584.5 4.29299427640740654.4830000000000005 4.2795228256414654.467 4.2661611793450094.467 4.25290575325539954.45 4.2397531052430494.45 4.2266999272458914.449999999999999 4.2137430377583834.433 4.2008793748293054.433 4.1881059895269714.417 4.1754200398343644.417 4.16281878494012954.417 4.1502995798944894.417 4.1378598706019194.4 4.1254971891249194.383 4.1132091492754524.367 4.1009934424726694.367 4.0888478338473444.367 4.07677015857508354.365999999999999 4.064758318421914.3500000000000005 4.0528102784871094.35 4.0409240641295014.35 4.0290977580643754.35 4.0173294976193634.333 4.0056174721384184.333 3.99395992052392854.333 3.9823551289077254.333 3.9708014284424774.333 3.95929719320556564.317000000000001 3.94784083820813654.3 3.9364308175025474.3 3.92506562238191454.283 3.91374377966592534.283 3.9024638500674594.267 3.8912244266349824.267 3.8800241332659774.25 3.8688616232870384.25 3.85773557809649774.25 3.84664470586578134.25 3.83558774029588674.2330000000000005 3.82456343942563364.233 3.8135705844885544.233 3.8026079788154524.2 3.79167444677988734.183 3.78076883278396464.167 3.7698900002819884.167 3.7590368308396784.167 3.7482082232267724.166999999999999 3.73740309254096034.150000000000001 3.7266203693612184.15 3.7158589989287054.15 3.7051179403534814.15 3.69439616584540654.133 3.6836926599676494.133 3.6730064189113144.117 3.66233644978977064.116999999999999 3.65168176995133554.1 3.64104140630899934.1 3.63041439468596934.083 3.61979977917584074.083 3.609196611516244.083 3.59860395047485644.083 3.58802086124678484.083 3.5774464148621674.067 3.566879687603124.066999999999999 3.5563197604294.05 3.54576571840904764.033 3.53521665016150084.033 3.5246716472982724.000000000000001 3.51412980387430944.0 3.5035902158407684.0 3.49305198050113354.0 3.48251419596945374.0 3.47197596062981974.0 3.4614363725962783.967 3.4508945291723153.966 3.44034952630908643.95 3.4298004580615393.95 3.4192464160415873.917 3.40868648886746733.917 3.398119761608423.917 3.3875453152238023.883 3.3769622259957313.85 3.3663695649543473.85 3.35576639729474653.8330000000000006 3.3451517817846183.833 3.33452477016158833.833 3.32388440651925173.833 3.3132297266808163.8329999999999997 3.3025597575592733.817 3.29187351650293763.767 3.28117001062518073.767 3.27044823611710633.75 3.2597071775418823.733 3.2489458071093693.7170000000000005 3.2381630839296273.683 3.2273579532438153.6 3.21652934563090883.6 3.20567617618859923.6 3.19479734368662263.6 3.18389172969073.567 3.17295819765513533.5669999999999993 3.16199559198203333.5 3.15100273704495363.5 3.1399784361747013.450000000000001 3.1289214706048063.417 3.11783059837408953.367 3.10670455318354933.333 3.09554204320460973.333 3.08434174983560543.317 3.07310232640312763.067 3.0618223968046622.8999999999999995 3.05050055408867272.883 3.039135358968042.800000000000001 3.02772533826245072.6330000000000022 3.01626898326502162.617 3.00476474802811032.483 2.9932110475628622.417 2.98160625594665872.417 2.96994870433216862.4 2.95823667885122442.4 2.94646841840621182.3829999999999996 2.9346421123410862.367 2.92275589798347822.3500000000000005 2.91080785804867762.333 2.89879601789550372.317 2.88671834262324322.3 2.87457273399791772.2829999999999995 2.86235702719513572.267 2.85006898734566862.25 2.83770630586866762.25 2.82526659657609752.233 2.81274739153045732.233 2.80014613663622262.2170000000000005 2.78746018694361642.2 2.77468680164128272.2 2.76182313871220362.2 2.74886624922469652.183 2.7358130712275382.167 2.72266042321518682.167 2.70940499712557832.15 2.69604335082912262.133 2.68257190006318022.1 2.66898690976142872.1 2.65528448472205362.1 2.64146055955254242.083 2.62751088782190222.083 2.61343103034326242.067 2.59921634250092962.033 2.58486196052586432.033 2.5703627866120642.017 2.5557134727532652.017 2.5409084031644252.017 2.52594167513536052.0 2.51080707814430062.0 2.4954980710365312.0 2.4800077570473412.0 2.46432885641836071.983 2.4484536763215551.983 2.4323740777646041.9829999999999999 2.41608143910416431.9670000000000003 2.39956661573824271.967 2.38281989548411.967 2.36583094907181041.95 2.348588775093451.933 2.33108163864107581.933 2.31329700273949261.917 2.2952214515279651.9169999999999998 2.2768406039627981.883 2.2581390165932511.883 2.2391000736975951.883 2.2197058627431091.883 2.19993703273907531.867 2.1797726325668061.867 2.1591899257716861.867 2.1381641775576451.867 2.1166684087936541.867 2.09467311067020741.867 2.0721459121590231.867 2.04905119053336151.867 2.02534961276698631.85 2.00099759246400751.85 1.97594664282682091.833 1.9501426006893841.833 1.92352468932313811.833 1.89602437783565031.833 1.8675639814654271.833 1.83805492835543461.833 1.80739559208819231.833 1.7754685517416031.817 1.74213708676900181.817 1.70724063348453941.817 1.67058880837279621.8 1.6319534156322931.8 1.59105755858840371.8 1.54756048846636051.8 1.50103600343795551.783 1.45094077165142331.783 1.39656631260767481.75 1.33696326949824451.75 1.2708161013298241.75 1.19622296029091221.75 1.11027824617048761.75 1.00819592762460971.75 0.88118338271587811.733 0.70999926526821171.7 0.43546026381077231.667 h,j,k,l,arrows,drag to pan i,o,+,-,scroll,shift-drag to zoom r,dbl-click to reset c for coordinates ? for help ? -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 -6.0 -5.5 -5.0 -4.5 -4.0 -3.5 -3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0 10.5 11.0 11.5 12.0 -10 0 10 20 -6.0 -5.8 -5.6 -5.4 -5.2 -5.0 -4.8 -4.6 -4.4 -4.2 -4.0 -3.8 -3.6 -3.4 -3.2 -3.0 -2.8 -2.6 -2.4 -2.2 -2.0 -1.8 -1.6 -1.4 -1.2 -1.0 -0.8 -0.6 -0.4 -0.2 0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 3.8 4.0 4.2 4.4 4.6 4.8 5.0 5.2 5.4 5.6 5.8 6.0 6.2 6.4 6.6 6.8 7.0 7.2 7.4 7.6 7.8 8.0 8.2 8.4 8.6 8.8 9.0 9.2 9.4 9.6 9.8 10.0 10.2 10.4 10.6 10.8 11.0 11.2 11.4 11.6 11.8 12.0 Sample q 1 Sample, 2 Distributions Theoretical q -2 -1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0 10.5 11.0 11.5 12.0 12.5 13.0 13.5 14.0 -5 0 5 10 15 -1.0 -0.8 -0.6 -0.4 -0.2 0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 3.8 4.0 4.2 4.4 4.6 4.8 5.0 5.2 5.4 5.6 5.8 6.0 6.2 6.4 6.6 6.8 7.0 7.2 7.4 7.6 7.8 8.0 8.2 8.4 8.6 8.8 9.0 9.2 9.4 9.6 9.8 10.0 10.2 10.4 10.6 10.8 11.0 11.2 11.4 11.6 11.8 12.0 12.2 12.4 12.6 12.8 13.0 13.2 13.4 13.6 13.8 14.0 setosa versicolor virginica Species 8.1443160768333257.7 7.98153371220608057.7 7.8790715274783987.7 7.80248445937887.7 7.7405366305681417.6 7.6880813512981347.399999999999998 7.64231173771522257.3 7.6015209137885237.2 7.5645900179858117.2 7.53074408809550467.2 7.4994231881564137.1 7.4702089694365737.0 7.4427802468495466.9 7.4168848056209076.9 7.3923207876703326.9 7.368923989159476.9 7.3465589444852066.8 7.3251125144014366.8 7.3044891765631786.8 7.28460750169199766.7 7.2653974731711856.7 7.2467984180665566.7 7.2287573889257676.7 7.2112278829988166.7 7.19416881751862656.7 7.1775437017381256.7 7.1613199618866146.7 7.1454683862223276.600000000000001 7.1299626653134816.599999999999998 7.1147790085016516.5 7.0998958218129256.5 7.0852934358111536.5 7.0709538743309526.5 7.0568606568946766.5 7.04299862905643356.4 7.0293538160348116.4 7.0159132958721836.4 7.0026650890502496.4 6.9895980620410576.4 6.97670184271259956.4 6.9639667458620276.399999999999999 6.95138370743611046.3 6.9389442262319356.3 6.9266403120617826.3 6.9144644395231936.3 6.9024095066450236.3 6.8904687977880436.3 6.8786359502684386.3 6.8669049242477696.3 6.85526997549610156.3 6.8437256306883076.2 6.8322666649385976.2 6.8208880813166746.2 6.8095850921214296.199999999999998 6.7983531017160316.1 6.7871876907520536.1 6.7760846016308036.1 6.7650397250676346.1 6.7540490876402556.1 6.7431088402151546.1 6.73221524715768556.0 6.7213646762411876.0 6.710553589179066.0 6.6997785327111796.0 6.6890361301824346.0 6.6783230735567696.0 6.6676361158149585.9 6.6569720636884885.9 6.6463277706855385.9 6.6357001303680785.8 6.6250860698417295.8 6.61448254342217555.8 6.6038865264436965.8 6.5932950091768235.8 6.5827049908231735.8 6.5721134735563015.8 6.5615174565778215.7 6.5509139301582675.7 6.5402998696319195.7 6.5296722293144595.7 6.5190279363115095.7 6.5083638841850385.7 6.4976769264432275.7 6.4869638698175625.7 6.4762214672888175.6 6.4654464108209375.6 6.454635323758815.6 6.4437847528423115.6 6.4328911597848435.6 6.4219509123597415.6 6.4109602749323625.5 6.3999153983691945.5 6.3888123092479435.5 6.3776468982839665.5 6.3664149078785685.5 6.3551119186833225.5 6.34373333506139855.5 6.332274369311695.4 6.3207300245038955.4 6.3090950757522285.4 6.2973640497315585.4 6.2855312022119545.4 6.2735904933549735.4 6.2615355604768045.300000000000001 6.2493596879382155.2 6.2370557737680625.2 6.2246162925638865.2 6.2120332541379695.2 6.1992981572873975.1 6.186401937958945.1 6.1733349109497475.1 6.1600867041278145.1 6.1466461839651865.1 6.1330013709435635.1 6.1191393431053215.1 6.1050461256690455.1 6.0907065641888445.099999999999999 6.0761041781870715.0 6.0612209914983455.0 6.0460373346865165.0 6.0305316137776695.0 6.0146800381133835.0 5.9984562982618715.0 5.981831182481375.0 5.964772117001185.0 5.947242611074235.0 5.9292015819334415.0 5.9106025268288124.9 5.8913924983079994.9 5.8715108234368194.9 5.8508874855985614.9 5.829441055514794.9 5.8070760108405284.9 5.7836792123296644.8 5.7591151943790894.8 5.73321975315045054.8 5.7057910305634234.8 5.6765768118435834.8 5.6452559119044924.7 5.6114099820141864.7 5.5744790862114744.6 5.5336882622847744.6 5.48791864870186254.6 5.4354633694318564.6 5.3735155406211984.5 5.2969284725215984.4 5.1944662877939174.4 5.0316839231666734.4 7.199329509343597.7 7.0671919777100667.7 6.9840189619678677.7 6.9218499047920287.7 6.8715641554245167.6 6.8289839217501997.399999999999998 6.791830733955477.3 6.7587190464620837.2 6.72874063065789057.2 6.7012664159799827.2 6.6758418780334477.1 6.65212742494093157.0 6.6298623367858986.9 6.6088418798564956.9 6.5889021971616096.9 6.5699099972975026.9 6.5517553169370236.8 6.5343463160289116.8 6.5176054549274536.8 6.5014666339425516.7 6.485873017538456.7 6.4707753548532496.7 6.4561306661349646.7 6.4419012030770546.7 6.4280536170090636.7 6.414558286803076.7 6.4013887709113936.7 6.3885213568915936.600000000000001 6.3759346882325836.599999999999998 6.36360945302126356.5 6.3515281224889756.5 6.3396747300981426.5 6.32803468381278666.5 6.3165946057117686.5 6.3053421942716546.4 6.2942661055540166.4 6.2833558502433316.4 6.27260170404316.4 6.26199462938401656.4 6.25152620675501156.4 6.2411885742553126.399999999999999 6.2309743741983356.3 6.2208767057875996.3 6.2108890830399046.3 6.2010053972584756.3 6.1912198834641726.3 6.18152709028028556.3 6.1719218528393826.3 6.1623992683416726.3 6.1529546739456616.3 6.1435836267150766.2 6.1342818853826736.2 6.1250453937225996.2 6.1158702653494476.199999999999998 6.1067527697847456.1 6.0976893196509886.1 6.0886764588699786.1 6.079710851756486.1 6.0707892729106486.1 6.061908597823256.1 6.0530657941170256.0 6.044257913355476.0 6.0354820833573266.0 6.0267355009610216.0 6.0180154251886086.0 6.0093191707632166.0 6.0006441019379875.9 5.9919876265978625.9 5.9833471905984555.9 5.9747202723087885.8 5.9661043773267235.8 5.9574970333377165.8 5.9488957850889315.8 5.9402981894519395.8 5.9317018105480615.8 5.9231042149110695.8 5.9145029666622845.7 5.9058956226732775.7 5.89727972769121145.7 5.88865280940154455.7 5.88001237340213745.7 5.8713558980620135.7 5.8626808292367845.7 5.8539845748113925.7 5.8452644990389785.6 5.83651791664267355.6 5.82774208664452955.6 5.8189342058829755.6 5.810091402176755.6 5.8012107270893525.6 5.792289148243525.5 5.7833235411300225.5 5.7743106803490125.5 5.7652472302152555.5 5.7561297346505525.5 5.7469546062774015.5 5.7377181146173275.5 5.7284163732849245.4 5.7190453260543395.4 5.7096007316583285.4 5.70007814716061745.4 5.6904729097197145.4 5.6807801165358285.4 5.6709946027415255.300000000000001 5.6611109169600965.2 5.6511232942124015.2 5.64102562580166565.2 5.6308114257446885.2 5.6204737932449895.1 5.6100053706159835.1 5.59939829595695.1 5.5886441497566695.1 5.5777338944459845.1 5.5666578057283465.1 5.5554053942882325.1 5.5439653161872135.1 5.53232526990185755.099999999999999 5.5204718775110255.0 5.5083905469787365.0 5.4960653117674175.0 5.4834786431084075.0 5.4706112290886075.0 5.457441713196935.0 5.4439463829909375.0 5.43009879692294555.0 5.4158693338650365.0 5.4012246451467515.0 5.386126982461554.9 5.3705333660574494.9 5.3543945450725474.9 5.3376536839710894.9 5.3202446830629774.9 5.30209000270249754.9 5.2830978028383914.8 5.2631581201435054.8 5.2421376632141024.8 5.2198725750590684.8 5.1961581219665534.8 5.17073358402001754.7 5.1432593693421094.7 5.1132809535379174.6 5.080169266044534.6 5.0430160782498014.6 5.0004358445754854.6 4.9501500952079734.5 4.8879810380321324.4 4.8048080222899354.4 4.672670490656414.4 5.8687189375638397.7 5.7784831360092527.7 5.7216848618896417.7 5.6792300450272117.7 5.644890256438347.6 5.61581251093723657.399999999999998 5.5904408573311777.3 5.5678291161789557.2 5.54735706447656357.2 5.5285951143107347.2 5.5112328741326497.1 5.4950384390105617.0 5.4798337651263466.9 5.4654790412517616.9 5.4518623705869326.9 5.43889272935906656.9 5.4264950243766656.8 5.4146065387073186.8 5.4031743210661276.8 5.39215323243434156.7 5.3815044602197876.7 5.3711943713513326.7 5.36119361525526.7 5.351476413875336.7 5.3420199936365536.7 5.3328041264765786.7 5.3238107556463496.7 5.3150236880838066.600000000000001 5.3064283395760276.599999999999998 5.2980115221518396.5 5.2897612655370086.5 5.2816666662940446.5 5.2737177596230416.5 5.2659054098346756.5 5.2582212163041286.4 5.25065743233472756.4 5.2432068948458396.4 5.2358629631829986.4 5.2286194656529686.4 5.2214706526301826.4 5.214411155277276.399999999999999 5.2074359490812256.3 5.2005403215361146.3 5.1937198434091076.3 5.18697034311365456.3 5.1802878837855866.3 5.1736687427176526.3 5.1671093928577966.3 5.1606064861181336.3 5.1541568382766286.3 5.1477574152829926.2 5.1414053208053176.2 5.1350977848751746.2 5.12883215350698856.199999999999998 5.1226058791829526.1 5.1164165121079136.1 5.1102616921500986.1 5.1041391413932576.1 5.0980466572342616.1 5.0919821059674816.1 5.08594341680357156.0 5.0799285762757466.0 5.0739356229913946.0 5.0679626426909696.0 5.06200776357969056.0 5.0560691519006546.0 5.0501450077206585.9 5.0442335609023535.9 5.0383330672382975.9 5.0324418047242295.8 5.02655806995027455.8 5.020680174590025.8 5.01480644196837755.8 5.0089352036899315.8 5.0030647963100685.8 4.9971935580316215.8 4.9913198254099785.7 4.9854419300497245.7 4.979558195275775.7 4.9736669327617015.7 4.96776643909764555.7 4.961854992279345.7 4.9559308480993455.7 4.9499922364203085.7 4.9440373573090295.6 4.9380643770086055.6 4.9320714237242535.6 4.9260565831964275.6 4.9200178940325185.6 4.9139533427657385.6 4.9078608586067425.5 4.9017383078499015.5 4.8955834878920865.5 4.8893941208170465.5 4.883167846493015.5 4.8769022151248255.5 4.8705946791946815.5 4.8642425847170065.4 4.8578431617233715.4 4.8513935138818665.4 4.8448906071422035.4 4.8383312572823475.4 4.8317121162144135.4 4.8250296568863445.300000000000001 4.8182801565908925.2 4.8114596784638845.2 4.8045640509187735.2 4.7975888447227285.2 4.7905293473698175.1 4.7833805343470315.1 4.7761370368175.1 4.768793105154165.1 4.7613425676652715.1 4.75377878369587055.1 4.7460945901653245.1 4.7382822403769575.1 4.7303333337059545.099999999999999 4.7222387344629915.0 4.713988477848165.0 4.70557166042397155.0 4.6969763119161935.0 4.688189244353655.0 4.6791958735234215.0 4.6699800063634465.0 4.6605235861246685.0 4.6508063847447995.0 4.6408056286486675.0 4.63049553978021144.9 4.6198467675656574.9 4.6088256789338714.9 4.5973934612926814.9 4.58550497562333354.9 4.5731072706409324.9 4.5601376294130674.8 4.5465209587482374.8 4.5321662348736534.8 4.5169615609894374.8 4.500767125867354.8 4.4834048856892644.7 4.4646429355234354.7 4.4441708838210444.6 4.4215591426688224.6 4.3961874890627624.6 4.3671097435616594.6 4.3327699549727884.5 4.2903151381103574.4 4.2335168639907474.4 4.1432810624361594.4 h,j,k,l,arrows,drag to pan i,o,+,-,scroll,shift-drag to zoom r,dbl-click to reset c for coordinates ? for help ? -1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0 10.5 11.0 11.5 12.0 0 5 10 15 0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 3.8 4.0 4.2 4.4 4.6 4.8 5.0 5.2 5.4 5.6 5.8 6.0 6.2 6.4 6.6 6.8 7.0 7.2 7.4 7.6 7.8 8.0 8.2 8.4 8.6 8.8 9.0 9.2 9.4 9.6 9.8 10.0 10.2 10.4 10.6 10.8 11.0 11.2 11.4 11.6 11.8 12.0 Sample q 3 Samples, 1 Distribution

Stat.smooth

using Compose, Gadfly, RDatasets
set_default_plot_size(21cm,8cm)
salaries = dataset("car","Salaries")
salaries.Salary /= 1000.0
salaries.Discipline = ["Discipline $(x)" for x in salaries.Discipline]

p = plot(salaries[salaries.Rank.=="Prof",:], x=:YrsService, y=:Salary,
    color=:Sex, xgroup = :Discipline,
    Geom.subplot_grid(Geom.point,
  layer(Stat.smooth(method=:lm, levels=[0.95, 0.99]), Geom.line, Geom.ribbon)),
    Scale.xgroup(levels=["Discipline A", "Discipline B"]),
    Guide.colorkey(title="", pos=[0.43w, -0.4h]),
    Theme(point_size=2pt, alphas=[0.5])
)
YrsService by Discipline Discipline B Discipline A -70 -60 -50 -40 -30 -20 -10 0 10 20 30 40 50 60 70 80 90 100 110 120 130 -60 -55 -50 -45 -40 -35 -30 -25 -20 -15 -10 -5 0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100 105 110 115 120 -100 0 100 200 -60 -58 -56 -54 -52 -50 -48 -46 -44 -42 -40 -38 -36 -34 -32 -30 -28 -26 -24 -22 -20 -18 -16 -14 -12 -10 -8 -6 -4 -2 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 102 104 106 108 110 112 114 116 118 120 -70 -60 -50 -40 -30 -20 -10 0 10 20 30 40 50 60 70 80 90 100 110 120 130 -60 -55 -50 -45 -40 -35 -30 -25 -20 -15 -10 -5 0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100 105 110 115 120 -100 0 100 200 -60 -58 -56 -54 -52 -50 -48 -46 -44 -42 -40 -38 -36 -34 -32 -30 -28 -26 -24 -22 -20 -18 -16 -14 -12 -10 -8 -6 -4 -2 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 102 104 106 108 110 112 114 116 118 120 21,145.028 20,138.0 27,142.5 38,93.519 49,186.96 28,144.309 33,128.25 27,142.023 10,107.986 35,150.376 31,162.15 38,114.596 17,124.312 11,106.231 15,137.317 25,128.464 12,145.0 23,98.053 38,151.445 19,145.098 10,105.45 9,116.518 60,192.253 23,134.778 37,151.65 15,124.714 31,162.221 15,161.101 23,104.428 15,135.027 16,134.55 45,67.559 20,129.6 10,145.2 21,170.0 11,119.5 11,146.0 11,145.35 19,126.2 7,128.4 39,111.35 20,163.2 18,120.0 33,162.2 2,96.545 5,165.0 17,152.5 17,160.4 40,119.7 22,114.5 33,189.409 18,122.1 22,133.7 9,180.0 19,153.75 10,107.5 30,134.0 23,101.0 22,150.0 5,141.136 11,142.467 14,147.349 25,111.751 20,134.185 24,93.164 19,151.575 18,181.257 19,130.664 16,167.284 8,105.89 19,176.5 16,137.167 21,118.971 9,111.168 12,128.148 26,144.651 27,156.938 28,119.015 27,112.696 14,127.512 5,153.303 23,126.933 25,133.217 26,106.689 14,102.235 7,129.676 20,123.683 38,166.024 25,172.272 37,152.708 14,132.825 18,122.96 20,144.64 16,135.585 28,150.743 19,193.0 3,150.48 23,113.398 34,92.391 19,100.131 45,146.856 2,126.32 36,91.412 17,111.512 31,99.418 12,101.0 31,109.785 21,117.704 9,106.639 11,108.875 28,126.621 25,140.096 19,151.768 28,98.193 15,114.778 19,94.384 38,231.545 27,101.299 2,146.5 31,125.196 21,155.75 9,117.256 4,132.261 8,118.223 20,101.0 3,117.15 18,104.8 18,129.0 20,119.25 45,147.765 23,175.0 41,141.5 39,115.0 16,173.2 18,139.75 15,95.329 25,101.738 19,150.564 30,103.106 19,151.292 19,166.605 18,186.023 36,119.45 15,109.305 27,139.219 9,114.33 21,125.192 44,105.0 23,172.505 38,150.68 26,103.649 19,103.275 26,136.66 7,109.707 20,110.515 31,134.69 30,131.95 10,115.435 40,101.036 43,205.5 30,138.771 15,109.646 11,121.946 14,109.954 35,107.309 40,88.709 6,146.8 35,100.351 19,94.35 9,108.1 7,92.05 15,166.8 28,122.5 31,111.35 44,144.05 4,105.26 13,170.5 16,127.1 36,88.6 43,72.3 11,148.8 18,126.3 36,97.15 7,107.3 9,183.8 28,168.5 7,174.5 27,150.5 27,115.8 43,155.865 51,57.8 27,103.6 38,136.5 46,100.6 18,107.1 27,163.2 48,107.2 6,93.0 18,194.8 40,143.25 7,103.7 44,89.65 10,104.35 43,143.94 30,134.8 35,99.0 31,126.0 26,121.2 45,107.55 30,92.55 22,140.3 7,116.45 12,132.0 8,102.0 39,109.0 7,204.0 23,128.8 18,101.1 23,91.1 11,90.45 23,84.273 23,108.2 37,102.6 30,122.875 6,96.2 40,77.202 25,114.0 17,81.7 19,117.555 19,148.75 27,91.0 38,133.9 11,88.175 20,122.4 35,87.8 11,106.608 18,152.664 14,105.668 14,108.262 18,136.0 25,168.635 57,76.84 30,113.278 26,155.5 49,78.162 22,96.614 22,97.262 32,124.309 14,115.313 36,117.515 29,148.5 9,120.806 0,105.0 37,104.279 16,112.429 31,131.205 28,113.543 23,134.885 8,106.294 19,113.068 30,93.904 31,102.58 26,89.565 36,137.0 23,124.75 34,103.45 -300 -250 -200 -150 -100 -50 0 50 100 150 200 250 300 350 400 450 500 550 -260 -240 -220 -200 -180 -160 -140 -120 -100 -80 -60 -40 -20 0 20 40 60 80 100 120 140 160 180 200 220 240 260 280 300 320 340 360 380 400 420 440 460 480 500 -250 0 250 500 -250 -240 -230 -220 -210 -200 -190 -180 -170 -160 -150 -140 -130 -120 -110 -100 -90 -80 -70 -60 -50 -40 -30 -20 -10 0 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210 220 230 240 250 260 270 280 290 300 310 320 330 340 350 360 370 380 390 400 410 420 430 440 450 460 470 480 490 500 Male Female Salary
using DataFrames, Gadfly
set_default_plot_size(14cm, 8cm)
x = range(0.1, stop=4.9, length=30)
D = DataFrame(x=x, y=x.+randn(length(x)))
p = plot(D, x=:x, y=:y, Geom.point,
  layer(Stat.smooth(method=:lm, levels=[0.90,0.99]), Geom.line, Geom.ribbon(fill=false)),
     Theme(lowlight_color=c->"gray", line_style=[:solid, :dot])
)
x -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11 -5.0 -4.5 -4.0 -3.5 -3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0 -5 0 5 10 -5.0 -4.8 -4.6 -4.4 -4.2 -4.0 -3.8 -3.6 -3.4 -3.2 -3.0 -2.8 -2.6 -2.4 -2.2 -2.0 -1.8 -1.6 -1.4 -1.2 -1.0 -0.8 -0.6 -0.4 -0.2 0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 3.8 4.0 4.2 4.4 4.6 4.8 5.0 5.2 5.4 5.6 5.8 6.0 6.2 6.4 6.6 6.8 7.0 7.2 7.4 7.6 7.8 8.0 8.2 8.4 8.6 8.8 9.0 9.2 9.4 9.6 9.8 10.0 4.95.1236639415945415 4.734482758620694.0857910741253916 4.5689655172413794.842611204779619 4.4034482758620695.195002504701055 4.23793103448275853.4375754021151135 4.0724137931034484.107922059526255 3.9068965517241383.992767976624603 3.74137931034482743.1102867960007323 3.5758620689655171.8598553056163665 3.4103448275862073.506423176253704 3.24482758620689673.888036205840213 3.0793103448275863.7097949046331724 2.9137931034482764.751394901784543 2.74827586206896561.8294619728000718 2.58275862068965531.9857062888307766 2.41724137931034472.489270577398729 2.25172413793103441.8653621575453705 2.0862068965517241.8320121533789155 1.92068965517241372.882931073697085 1.75517241379310350.3927434572513049 1.5896551724137931.1669398573016456 1.42413793103448282.1121293554397504 1.25862068965517240.8253280905880598 1.09310344827586210.1632698913543228 0.9275862068965517-0.7137276968158517 0.76206896551724131.7868092494125287 0.5965517241379310.6064197782701288 0.43103448275862066-1.0777001238387638 0.2655172413793103-0.3182382032287451 0.1-0.2225696498949116 h,j,k,l,arrows,drag to pan i,o,+,-,scroll,shift-drag to zoom r,dbl-click to reset c for coordinates ? for help ? -12 -10 -8 -6 -4 -2 0 2 4 6 8 10 12 14 16 -10.0 -9.5 -9.0 -8.5 -8.0 -7.5 -7.0 -6.5 -6.0 -5.5 -5.0 -4.5 -4.0 -3.5 -3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0 10.5 11.0 11.5 12.0 12.5 13.0 13.5 14.0 -10 0 10 20 -10.0 -9.5 -9.0 -8.5 -8.0 -7.5 -7.0 -6.5 -6.0 -5.5 -5.0 -4.5 -4.0 -3.5 -3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0 10.5 11.0 11.5 12.0 12.5 13.0 13.5 14.0 y

Stat.step

using Gadfly, Random
set_default_plot_size(14cm, 8cm)
Random.seed!(1234)
plot(x=rand(25), y=rand(25), Stat.step, Geom.line)
x -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 -1.0 -0.9 -0.8 -0.7 -0.6 -0.5 -0.4 -0.3 -0.2 -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 -1 0 1 2 -1.00 -0.95 -0.90 -0.85 -0.80 -0.75 -0.70 -0.65 -0.60 -0.55 -0.50 -0.45 -0.40 -0.35 -0.30 -0.25 -0.20 -0.15 -0.10 -0.05 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 h,j,k,l,arrows,drag to pan i,o,+,-,scroll,shift-drag to zoom r,dbl-click to reset c for coordinates ? for help ? -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 -1.0 -0.9 -0.8 -0.7 -0.6 -0.5 -0.4 -0.3 -0.2 -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 -1 0 1 2 -1.00 -0.95 -0.90 -0.85 -0.80 -0.75 -0.70 -0.65 -0.60 -0.55 -0.50 -0.45 -0.40 -0.35 -0.30 -0.25 -0.20 -0.15 -0.10 -0.05 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 y

Stat.x_jitter, Stat.y_jitter

using Gadfly, Distributions, Random
set_default_plot_size(14cm, 8cm)
Random.seed!(1234)
plot(x=rand(1:4, 500), y=rand(500), Stat.x_jitter(range=0.5), Geom.point)
x -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11 -5.0 -4.5 -4.0 -3.5 -3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0 -5 0 5 10 -5.0 -4.8 -4.6 -4.4 -4.2 -4.0 -3.8 -3.6 -3.4 -3.2 -3.0 -2.8 -2.6 -2.4 -2.2 -2.0 -1.8 -1.6 -1.4 -1.2 -1.0 -0.8 -0.6 -0.4 -0.2 0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 3.8 4.0 4.2 4.4 4.6 4.8 5.0 5.2 5.4 5.6 5.8 6.0 6.2 6.4 6.6 6.8 7.0 7.2 7.4 7.6 7.8 8.0 8.2 8.4 8.6 8.8 9.0 9.2 9.4 9.6 9.8 10.0 2.8712597494860850.8688707602114859 3.90884067575680570.7844962241285454 4.2014967064336270.4933114676059782 2.8761044222740660.20022370872836803 2.92891828508707340.20968130045034283 2.78390869002773520.38636188269952176 4.1540847037771450.20347016439928334 2.06530122447205060.36346714080005693 3.9750557120175140.9006551405197767 4.2069651933828380.5601212750115374 4.1590095831739340.41599712143214107 2.81509726300803550.06337029084489987 2.2191516662950040.25571730367793133 1.89561480552621390.8394899341730585 2.89572224818001980.4722104397712146 3.1619889707102110.8994205095858897 2.02793302385898460.7098322716968657 2.243811014935740.7032030724629521 2.0287919878980740.8587698550547092 4.055445782623950.8147518729572419 2.0208082508583720.17645290580491135 1.9879890479051410.5218498496945619 0.92389981202464520.397287897949688 1.98544329088483670.08241379533623139 2.1778156681076440.22152131696852717 3.2132729454540690.2434992488546217 1.8649664072617470.30065587786042136 4.1683785836592610.489277411012798 1.88764125329319230.06178649155507521 2.17026487372069270.8817395195040358 3.92780526883187870.23362897774250269 0.87650630409778250.8255340069167519 4.0432409163642910.9105974192931239 4.2452746207158590.5991438659250566 4.1033452351789710.1412748986274308 3.8062302679794830.7366810973361577 1.24196582016799750.43709223813367404 1.98160899261812860.6854790284282768 0.99671323218591520.9911127611685743 1.9074460439983090.6534693194895459 4.0600616252240170.6808836785816833 3.9697029433718960.19952370079780724 0.89088942250721110.4324597305101038 4.010239234022630.3705886993148091 4.1274456192291350.8513118835602637 2.86943155365610950.06533462152067271 1.80970218924360050.7622851899438685 1.85733649626418760.9305245964744348 1.92345128181091420.04526321728496874 4.0450377724757770.2540701150733844 3.9834566375209430.9389170955706365 2.75509057464444450.5744689301853781 1.12177867649153540.6401419378013135 2.04193069906356730.05136288720653859 0.85027402562036150.1115511154107186 2.87134088666257540.7654791906083002 3.78273713325283630.7569242593203886 3.0097053698180690.10043917697495508 2.9565868376540050.9180092814287552 1.9675850238235890.4519085995436555 2.09102600347075860.4966565997490733 3.9307148236662650.8496701726979725 3.88371962759620940.2797556635344246 3.16148151157757740.9031209367973443 1.20282767950029370.8337379298530495 3.8384762610623510.9202623263285435 4.1677016255738740.14752969866227228 3.99624935611840070.6203029982311218 1.752903313769290.6412455362756176 1.91263109801300860.8633707470087496 0.76611426760085030.5513297262619098 1.84703325897522050.7213181391973645 1.7989699747854320.5565117796386155 2.011312561262340.562391983355749 3.84753065878414050.8332854442345888 2.91438850069447140.683847959065649 1.93870405601566050.40434526102519175 2.8810009279871550.30621765112578814 4.22655434374681250.3822671853075492 2.1848433077145990.47861038568821057 4.2315706852444230.3913377406425659 1.82208498084682270.8528930050931623 0.86899031204470820.1910058465303195 0.95942749481530730.9319449966435072 2.84428701791341250.7301492979311955 1.75462250809559480.1716937223218291 1.76502516534107310.10540966113139583 1.800186637053180.14221287858362786 3.8071183858186140.5799623818434465 3.87923523330139370.8582735063047109 0.97241595342174250.9737954714715884 1.1017946678675860.04883640354012009 1.19713854311161620.9025551644489788 3.218302950602240.27986574868940217 2.78546548448190650.642259389228578 1.13450336129567340.7140000771545962 3.84680916021972760.5514339758243468 1.95121809777027620.41002221928315785 0.82290465864745440.4791719547087512 3.1006933357493220.6068327793530726 0.86969428029971290.8284301938432143 1.19922188161121350.06532217208669655 2.22736240427727860.9842933037760484 1.93162081377750280.7455808217291413 1.03415233755323980.6831405194880031 3.0269582457217740.9193478032857196 2.13943155066927960.05251671833846783 1.1316937106082710.30417155724859757 1.21865539842861730.7649296155316312 3.8870914479729310.54298931744888 3.0889825290383950.4698473493890444 3.0794431255458820.9624535633440595 0.79256522507845820.05938962971774009 4.09311226600018950.2892787961097918 3.1886865362168980.5824468146224191 2.96152542022626040.4339580706911712 2.1122555090557410.23829837438298052 1.99320088674342570.6802437761705059 2.0239655411868220.9758045059138829 1.77044912552940280.07026486226463047 1.87400100539144780.631724907029242 2.0199155646577680.11294303759673174 3.82079098584652770.6662179679029121 2.15462638955604020.1354497892449471 3.91114083630068080.37368905687339526 3.8720887497329750.6845749899644828 3.17442489271927550.13480216534545464 0.97250252264953090.26406861992335895 3.1008535597066160.8927396362839568 1.80059745657557620.03171441883005599 3.0028938815546660.849443710514651 1.88423177371639120.40853753061840636 1.02637636823164470.28294823714123485 2.0456276117348970.8231516374761443 1.9741197444118650.9560767968343468 1.13255056395567970.04661289240658861 3.96006212249316470.8668717472509425 1.02712689926106910.7144283934013788 0.98883464374242860.8400089067709939 1.2429428775124390.27494095179421774 0.85721121174327640.14283994035433067 3.9925418747703830.06193096369350859 2.9458808949474390.5543013918697022 2.8835642123430240.36781387880660465 0.97029987680635120.9409660265169163 2.12970652340058160.24735507677280189 4.1054537620315130.27286009818548573 3.1130142760270520.5130113748104197 2.87077110906373620.810095349938354 2.161179913117280.039244941424736335 2.07968833532424920.24890378913702726 2.7696471418158620.1751722300394265 1.804715297518420.0005917711362134481 4.1824049141869590.3719608058921303 4.072811924714030.058608492349195074 2.799770521768430.12011628613261238 1.76617074870835690.28143985356705925 2.24764273225316740.6202785432039485 2.2122079485985620.8700357516595604 3.91652606674083170.019972582532043703 0.93630187081043680.987908302749377 1.16122887372639070.7552467868535593 0.81701607493336560.5140433713604216 1.14901522248591470.7021756418052602 4.1909122118898990.18019934546680438 2.8464596710996580.46430881182502726 4.0631968498540790.27596643355398653 2.05868538795040120.031779235808084394 2.081024673632640.5029323603596401 2.0999857224716020.1322055312857282 0.8552997943745170.22624225698362654 2.03311159069952250.9901222460263335 1.86721261243744860.7018230289433646 2.93402131313415550.5483182356088243 2.07903629687126120.6851882186499314 2.083621290435720.25554705343485484 3.9796375197535250.8040460964694363 0.89539294224921820.23172871039837373 1.75199354453743350.39033820071475933 1.03444993669967490.04935999784699163 2.05322203265875560.5270047985994559 1.97819736502428340.12633860607778602 1.13669672982365680.6859244357507125 3.9458543430417380.9347001577624441 3.1388120129138190.6289955692908717 2.0454204894301640.4156080283059055 2.0053109149752350.4824761299463617 4.1426164442304880.7527410357550373 3.11457706661103150.1364677260308763 3.94017389289840820.5243925284587394 0.89288618288190950.8887742373097278 4.121528193386090.5973158992545364 0.86072132136157380.185888775682863 2.1639561594030930.08119296696646194 3.8314324897182210.8543586741980717 3.9718487515771610.43967094523384076 4.2118995781614010.857783472261158 4.2167424957096340.7620738638659255 2.1482293600074480.297193812375811 0.76643541622001920.6964472695956948 1.20245470901159470.8444267400793738 0.9569839052291050.1825057607253029 2.93062612877669970.5650379859078629 2.98379658262446770.6890488323646001 1.20847000285129710.7444158227835773 3.08724331754477980.9070250703704628 3.19818970901706660.7251897791927844 4.1087312021257710.9582538153032606 4.0117027638056480.7372812787327768 0.95387834184928060.15461746682785849 0.92177887686691240.6128807362063043 0.97074541895466850.260988098859801 4.21224227345058560.36597531632541225 2.89053643566361630.27638995986758275 1.06966771210481460.02853550112696346 3.97829491712853760.26623330759253705 2.9343597791690650.8822263611775025 1.0082259940667550.7797272162266058 1.24202612733899450.6723370448480452 4.0667298061719250.7189174328788034 1.09679460442816910.9104012565181274 2.2438175681615960.22814256947908007 4.0975178179132080.2926767210770894 1.80398564941876140.5335158113802787 3.91228646284267970.5224652349864496 0.85248094165445070.1854992374002269 1.92468672450880350.4313936472999286 3.9963221729939510.23163315976888965 0.98227644653067250.008941785599641316 1.01861978680671220.8801608411211824 0.90583025207289420.9495904988651728 3.12259010944273150.7251610128749185 0.76079710981379060.7653749686121726 2.04123089316883230.3889837880913415 3.9659071571322830.33454205519933766 1.17208693899642480.5409635231684314 1.23557494130732740.5417859419322087 1.76399132393748430.6995561236538012 2.0933754508327590.9768058652920141 3.07325747479750080.07157621671962944 1.17128656677569330.21095849801002242 1.79129309903202530.24484660314257278 1.09647728717019820.26819716438786256 3.04203340907237860.7607715755994937 1.0340684248389440.8443210731301258 3.82317726781159270.31529067609398276 2.86193123065980660.6484925911208542 3.24706716889914840.3685559216792129 0.94654552932500910.6205061868459367 3.92781475263438340.9523401569298326 2.06931864543716730.5187125306836177 4.2006977907464450.5916756129971316 3.17164003488570150.8101677940907962 3.9444791704311640.24882164172116517 1.17115188753051620.3039008559181663 1.11769242098911770.5730465638219848 4.21288391298796850.7172403284161356 0.96605697709104510.14386756622287056 1.93832610798619640.695696967985678 2.76771692359299060.5239610185536518 2.21875647328071770.5214146727674995 1.81757341803903080.19316006943534714 3.80452405450155150.8443182452610154 0.77215648756982250.04817127912951269 1.03634253106889070.0015749053225861953 4.1024404353448190.6176051821237512 4.2193731760611370.934486725639464 2.0961057900728310.215287910639833 2.98186568437307950.520000055822197 0.75909106962863750.8925689467243849 2.78964403448908360.27168082454940823 2.9925193197182150.5392913071429981 0.91955592853326070.5535703272043874 2.0704230829243950.66064841597728 2.9166028640134110.3669039349529569 3.8797079924654070.9749001931944528 3.19049261002831530.762504522777882 2.11090097913095050.520930941494485 0.97094766332092910.16272321889578512 2.20420085162979660.9537990881567351 1.19274320690306410.8363896294256541 3.21166583451170240.8682005168268859 3.06925487175301060.547207184165385 4.1077255897820470.925886679280969 2.75901256220109040.901074525624822 1.88451076785885550.3117414903705903 1.81134539331395740.6642422457423811 2.97776347688545240.5810909916932919 3.0643465224393010.8537548518511688 3.03469608703741270.46039783867502093 3.12057034794669260.9929498020696101 2.83617722602818740.6113158849330347 0.89789039109250890.58230855642697 3.0358075963978180.5296498813973983 1.0230433550643360.7490827228368587 2.0793864025271120.7000017994857771 3.11782310996961340.9036221496963194 1.00346683089635040.942588189733702 4.21516219142494550.9755806406492921 1.79223188928033820.7333388252259753 3.7577401019838910.5845543847866221 0.78615954455866980.7656854824149089 3.185063129435120.05537909946775932 2.75367379137047850.050307398032391704 2.83001953374771140.5148028287268799 4.127429892159790.7353569902097455 2.0620754209140630.6430375271161651 2.99506679619945440.36263693424831744 3.2071112073218610.05221968494849505 3.83247985161245230.33102535353292806 3.98197962066977860.1880083620572911 3.95644831148749930.5338124396263914 3.00149126495921740.5107420498787975 0.89089098010358680.7214471968410925 3.0644364214865650.255432407815942 1.978581400534030.3851255814540926 2.8622185278532910.8238123963398689 3.7770851181711870.7568890891259715 3.78358957965905240.41316557081364846 0.88276980287178860.20650303966258898 0.90740469371833190.8630007726329422 4.1121116870443220.5221762619529627 4.037552151920550.4159443871114292 2.15685602864908080.8501629612033895 4.0238882527834560.9489644615452483 1.00909329338628530.7897967712831379 0.82056082356963720.15379168745555616 2.99318573005473270.34543579552523984 0.83731494901795480.810119349113559 1.84989377086615560.11186312639075491 0.79864348884765690.5875124896588076 2.00412772168445260.6915070909179323 4.2240556446637120.3442663724650188 1.94990330497589270.8700132097492914 2.98745768026352380.808205815541499 3.0659273314892150.49160442382388414 2.88161578931266060.7328057998191583 2.85781001925149350.39938314903843464 0.77845165565383870.5354504488438098 3.24305523203814650.7393556116748278 4.0132703215497040.569011203662756 2.81451154671783940.6943160422603702 1.91259592597103010.35371234001492313 4.236040126338210.4155778038296022 4.2180903516420420.24639238863469104 3.8494767270981020.21866035522733784 1.98207116193151480.22728747265084115 2.13486343557437540.6530188065789416 0.91539620965199860.6849995836459672 2.81380110144793470.868808366582287 1.87275826021602220.697590587334583 4.2138464688042910.7869941993723283 3.24640620994204370.054774123323379276 1.1417158714713060.7546292452367565 3.8579210723123250.9936353001610227 3.93680750308554470.9702319861394001 4.14954123756714650.9548157677432825 1.97795669201679520.22546604456210773 2.0214435220706150.4254459101863406 1.97684906401709680.9111169553670773 3.1656118897456920.9445648966931448 0.98560014179000770.2520419991167283 1.8581503312089190.027371015824906864 3.09158798139164140.5501988481362968 4.0714249897892520.9738372307308305 1.1853228318768530.9591222449404715 4.0177444253893890.5671602112321875 2.907921226577160.48083979885980155 3.78660724312447350.8655859590804046 2.9441971701345140.0694571606662242 2.78281911351327740.6225106290225939 4.0697799300605080.9224603480171893 0.78424458078717060.18700487539883281 3.0773952805481220.21179779347166938 3.81500042649377360.4181464403606069 1.0763797882882740.6410620651668127 3.13310109181780.5856064192614485 2.1801914074107460.6745201531817407 3.20844538063262340.0567370392512806 2.89164597619780930.6753571923576499 2.036694315739890.6213908436925064 1.8759478581485820.22244967371095747 1.17689630024929310.2788303260944013 2.0901809630542290.23849788896293656 3.9534744556255310.3485998582193758 0.88265496789252830.4081267441800527 0.87879147613697080.5137956601251248 1.76583836985110180.14190452523901043 1.0455972671301860.22397456195988152 0.83719037841066110.996398361105594 2.94248134268714170.6580745507087566 4.0993740200823920.5637173765896986 1.08751627654943750.8001726293694157 2.8273041103292850.22387276972538217 2.99644469238850860.8589274960959142 1.18334706007171350.8323075439974053 3.880478699866740.4213947359498552 0.95174921781454340.8943592085408273 1.768249847565630.2266030921252029 2.0130091448939480.9741350476128602 3.9611883878472990.9921221717678421 1.78031137382426570.046836121816080545 2.08816596636458840.8212524740973319 3.17576282336098670.16362626503840627 2.2101402110154270.6902175471429484 1.2167735579748530.9390194666329318 4.0776549548980060.4909484824553295 2.13975706338253820.23655990729592613 2.09000575148672540.9231320499817033 3.1271542152184260.02212647541005819 1.98904534324881090.6070347210179184 3.8891551681173930.8054327605911276 2.82850618046347830.18267524521417788 3.78981971692565440.9942034287494077 1.16508759263563230.24794439300388094 1.89114917242930480.08784030377787089 4.0119238209425710.3827076222337582 3.7846729737133730.6401196266200835 4.1469300773784880.8594724440490045 1.80122419007952630.5743640780190793 0.79612028878587190.32550073923233824 3.7922842447558920.7818997197110137 2.1080403028134810.8281410033845884 3.06432819558836740.5045840112038369 4.0741711053431280.13916898846300385 1.96706391823923750.6528341367744794 0.88824937639516280.7146547486252668 3.76167195573254260.17834114894143083 3.19693955885152370.4459487663557117 0.78777852306703240.6882837111259372 3.22083221720861030.8023030112033331 1.05251996604918950.7821683036122776 0.78872244404170640.19568628922501163 2.96247686324456750.4358523793378436 2.04648741188338330.39198250169152393 3.11352777892138780.11360168459951026 2.10617558391210350.6642693805375591 0.91046736171434830.7557964922352066 2.7811987724154890.4644179392864445 2.03323890094838640.29075009103566896 0.76510891886003530.5565507355980254 2.9506657296631190.5872286665992463 3.0401844067709420.5760144499368227 4.16017618689966450.01563354657629501 1.8072683061510770.3312879052202624 4.2437632853301050.47239864678245225 3.9422873088232830.19619997571870074 2.90447547726741550.7483008772508714 3.88265311681619350.5023248535269951 2.0288605263728510.5264454911641667 2.9681270829736280.4107050281769109 3.8974711942350670.016168511270878594 4.0084261480817660.6891135870767084 0.90450094952487890.0028255728554108517 1.8972177196856280.821332885539736 3.0367212847756010.11271201175193979 1.94507484923431370.656538478901774 4.173043896589570.32526231681412365 2.2042488393354240.7992005896085951 4.2385214993286190.7647862761585806 1.15938391441513120.28313567425363695 3.0124899151026550.9837609431339588 0.94181147122043330.41226837667238525 2.7900503636512730.1738942370659159 3.2013887172819120.37372897688415463 3.07544044837156250.7911133365397495 3.7830837430045170.11713401014978575 1.12011311546150470.8916346864313749 2.0615076910923150.8244669978901201 3.19647910784920.4556905467926975 4.008710958077660.21992588087221654 3.19358102616396480.4762031536881922 3.2379747071246630.41012883792543287 1.24456439524632810.68072808956177 1.06279190041377820.9353666109683862 2.7844680204922230.9514084295478217 1.87643483856390430.880014210783719 2.83694780830631550.31322089348156024 2.0508421975189140.5769600659422053 0.82807355963134750.65590767426589 2.9623430351579350.06988563382132096 4.135029277997570.9470913943908873 2.78452415083122330.9193811550535141 3.89938963350588660.7318217460210769 2.90214901882118160.7594122645654858 2.03768799389502760.4704100989700123 1.06351530601658380.41601923074567215 0.98042140393878390.9764740463236247 3.0405154475217460.7713190608139815 2.7555314816374920.2989313514289098 3.103359404466510.3769511221635041 1.9291799198070140.7308833379516695 4.02749127253830250.12613981259427376 4.2156027473921070.6002177892737408 2.0215548193360940.6842244340377102 1.84040783350168930.23416319027706767 4.0780612824722620.668930559288584 0.89242683342386380.3970132824366758 2.96364594990007070.33380255641211753 2.01098082754497740.6182689195139303 h,j,k,l,arrows,drag to pan i,o,+,-,scroll,shift-drag to zoom r,dbl-click to reset c for coordinates ? for help ? -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 -1.0 -0.9 -0.8 -0.7 -0.6 -0.5 -0.4 -0.3 -0.2 -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 -1 0 1 2 -1.00 -0.95 -0.90 -0.85 -0.80 -0.75 -0.70 -0.65 -0.60 -0.55 -0.50 -0.45 -0.40 -0.35 -0.30 -0.25 -0.20 -0.15 -0.10 -0.05 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 y

Stat.xticks, Stat.yticks

using Gadfly, Random
set_default_plot_size(14cm, 8cm)
Random.seed!(1234)
plot(x=rand(10), y=rand(10), Stat.xticks(ticks=[0.0, 0.1, 0.9, 1.0]), Geom.point)
x 0.0 0.1 0.9 1.0 0.94645322623138340.0027764596470082337 0.131025656220859040.7285427707652774 0.9671427689153830.40573030892222206 0.83962193405807110.012846056572255682 0.63956159968027340.5239478383832243 0.5203549937237180.8406409194782338 0.0149088492850999450.5257956638691226 0.97213608245546870.08344008943212289 0.41129411794985050.5525344667850608 0.57986212013413240.749719144596962 h,j,k,l,arrows,drag to pan i,o,+,-,scroll,shift-drag to zoom r,dbl-click to reset c for coordinates ? for help ? -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 -1.0 -0.9 -0.8 -0.7 -0.6 -0.5 -0.4 -0.3 -0.2 -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 -1 0 1 2 -1.00 -0.95 -0.90 -0.85 -0.80 -0.75 -0.70 -0.65 -0.60 -0.55 -0.50 -0.45 -0.40 -0.35 -0.30 -0.25 -0.20 -0.15 -0.10 -0.05 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 y